# 答疑
# Date: 2025/3/28


def shortest_interval(s, a, e):
    pass


if __name__ == '__main__':
    n = int(input())
    s = []
    a = []
    e = []
    for _ in range(n):
        si, ai, ei = map(int, input().split())
        s.append(si)
        a.append(ai)
        e.append(ei)
    print(shortest_interval(s,a,e))

